﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
  xmlns:fxui="clr-namespace:SilverlightFX.UserInterface;assembly=SilverlightFX"
  xmlns:fxnav="clr-namespace:SilverlightFX.UserInterface.Navigation;assembly=SilverlightFX">

  <!-- Label -->
  <Style TargetType="fxui:Label">
    <Setter Property="IsTabStop" Value="false" />
    <Setter Property="FontFamily" Value="Verdana" />
    <Setter Property="FontSize" Value="11" />
    <Setter Property="Foreground" Value="#000000" />
    <Setter Property="TextWrapping" Value="NoWrap" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:Label">
          <Border
            Background="{TemplateBinding Background}"
            BorderBrush="{TemplateBinding BorderBrush}"
            BorderThickness="{TemplateBinding BorderThickness}"
            Padding="{TemplateBinding Padding}">
            <TextBlock
              Text="{TemplateBinding Text}"
              FontFamily="{TemplateBinding FontFamily}" 
              FontSize="{TemplateBinding FontSize}"
              FontStretch="{TemplateBinding FontStretch}"
              FontStyle="{TemplateBinding FontStyle}" 
              FontWeight="{TemplateBinding FontWeight}"
              Foreground="{TemplateBinding Foreground}"
              TextAlignment="{TemplateBinding TextAlignment}"
              TextDecorations="{TemplateBinding TextDecorations}" 
              TextWrapping="{TemplateBinding TextWrapping}" />
            </Border>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- Screen -->
  <Style TargetType="fxui:Screen">
    <Setter Property="Background" Value="White" />
    <Setter Property="FormBackground" Value="#20000000" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:Screen">
          <Grid x:Name="RootElement">
            <ContentPresenter x:Name="WindowPresenter" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- XBorder -->
  <Style TargetType="fxui:XBorder">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:XBorder">
          <Grid x:Name="NineGrid" Background="{TemplateBinding Background}">
            <Grid.RowDefinitions>
              <RowDefinition Height="0"/>
              <RowDefinition Height="*"/>
              <RowDefinition Height="0"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="0"/>
              <ColumnDefinition Width="*"/>
              <ColumnDefinition Width="0"/>
            </Grid.ColumnDefinitions>
            <Rectangle Grid.Row="0" Grid.Column="0">
              <Rectangle.Fill>
                <RadialGradientBrush x:Name="TopLeftShadow">
                  <RadialGradientBrush.RelativeTransform>
                    <TransformGroup>
                      <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
                      <TranslateTransform X="0.5" Y="0.5"/>
                    </TransformGroup>
                  </RadialGradientBrush.RelativeTransform>
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Grid.Row="0" Grid.Column="1">
              <Rectangle.Fill>
                <LinearGradientBrush x:Name="TopShadow" EndPoint="0.5,0" StartPoint="0.5,1" />
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Grid.Column="2" Grid.Row="0">
              <Rectangle.Fill>
                <RadialGradientBrush x:Name="TopRightShadow">
                  <RadialGradientBrush.RelativeTransform>
                    <TransformGroup>
                      <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
                      <TranslateTransform X="-0.5" Y="0.5"/>
                    </TransformGroup>
                  </RadialGradientBrush.RelativeTransform>
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Grid.Row="1" Grid.Column="0">
              <Rectangle.Fill>
                <LinearGradientBrush x:Name="LeftShadow" EndPoint="0,0.5" StartPoint="1,0.5" />
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Grid.Row="1" Grid.Column="2">
              <Rectangle.Fill>
                <LinearGradientBrush x:Name="RightShadow" EndPoint="1,0.5" StartPoint="0,0.5" />
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Grid.Row="2" Grid.Column="0">
              <Rectangle.Fill>
                <RadialGradientBrush x:Name="BottomLeftShadow">
                  <RadialGradientBrush.RelativeTransform>
                    <TransformGroup>
                      <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
                      <TranslateTransform X="0.5" Y="-0.5"/>
                    </TransformGroup>
                  </RadialGradientBrush.RelativeTransform>
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Grid.Row="2" Grid.Column="1">
              <Rectangle.Fill>
                <LinearGradientBrush x:Name="BottomShadow" EndPoint="0.5,1" StartPoint="0.5,0" />
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Grid.Column="2" Grid.Row="2"  >
              <Rectangle.Fill>
                <RadialGradientBrush x:Name="BottomRightShadow">
                  <RadialGradientBrush.RelativeTransform>
                    <TransformGroup>
                      <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2"/>
                      <TranslateTransform X="-0.5" Y="-0.5"/>
                    </TransformGroup>
                  </RadialGradientBrush.RelativeTransform>
                </RadialGradientBrush>
              </Rectangle.Fill>
            </Rectangle>
            <Rectangle Grid.Column="1" Grid.Row="1">
              <Rectangle.Fill>
                <SolidColorBrush x:Name="BackgroundShadow" />
              </Rectangle.Fill>
            </Rectangle>
            <Border x:Name="Border" Grid.Column="1" Grid.Row="1"
              BorderBrush="{TemplateBinding BorderBrush}"
              BorderThickness="{TemplateBinding BorderThickness}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- ContentView -->
  <Style TargetType="fxui:ContentView">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:ContentView">
          <Grid>
            <ContentPresenter x:Name="BackPresenter"
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
            <ContentPresenter x:Name="FrontPresenter"
              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  
  <!-- PageFrame -->
  <Style TargetType="fxnav:PageFrame">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxnav:PageFrame">
          <Grid>
            <fxui:ContentView x:Name="ContentView" ContentTransition="{TemplateBinding Transition}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- DetailView -->
  <Style TargetType="fxui:DetailViewItem">
    <Setter Property="HorizontalContentAlignment" Value="Left" />
    <Setter Property="VerticalContentAlignment" Value="Top" />
    <Setter Property="Cursor" Value="Arrow" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:DetailViewItem">
          <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"
            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="fxui:DetailView">
    <Setter Property="FontFamily" Value="Verdana" />
    <Setter Property="FontSize" Value="11" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:DetailView">
          <Grid x:Name="RootElement">
            <ContentControl
              Background="{TemplateBinding Background}"
              BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
              FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontWeight="{TemplateBinding FontWeight}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}"
              HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
              Padding="{TemplateBinding Padding}">
              <Grid x:Name="ItemPresenter" />
            </ContentControl>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <!-- ListView -->
  <Style TargetType="fxui:ListViewItem">
    <Setter Property="HorizontalContentAlignment" Value="Left" />
    <Setter Property="VerticalContentAlignment" Value="Top" />
    <Setter Property="Cursor" Value="Arrow" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:ListViewItem">
          <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"
            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
            VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="fxui:ListView">
    <Setter Property="FontFamily" Value="Verdana" />
    <Setter Property="FontSize" Value="11" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="fxui:ListView">
          <Grid x:Name="RootElement">
            <StackPanel x:Name="ItemsPresenter" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>
